package com.boomsecret.pattern.singleton;

/**
 * Created by wangjinliang on 2018/1/17.
 */
public class EnhanceHungerSingletonPattern {
    private static volatile EnhanceHungerSingletonPattern instance = null;

    public static EnhanceHungerSingletonPattern getInstance() {
        if (instance == null) {
            synchronized (EnhanceHungerSingletonPattern.class) {
                if (instance == null) {
                    instance = new EnhanceHungerSingletonPattern();
                }
            }
        }
        return instance;
    }

    public void invokeMethod() {
        System.out.println("LazySingletonPattern invokeMethod");
    }
}
